#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/07/18 08:55
# @File           : operation.py
# @IDE            : PyCharm
# @desc           : pydantic 模型，用于数据库序列化操作
from typing import List, Optional

from pydantic import BaseModel, ConfigDict
from core.data_types import DatetimeStr


class ApiCallRecord(BaseModel):
    config: Optional[dict] = None
    params: Optional[dict] = None
    process_time: float
    error: Optional[str] = None
    resposne_body: Optional[str] = None


class ApiCallRecordSimpleOut(ApiCallRecord):
    model_config = ConfigDict(from_attributes=True)

    create_datetime: DatetimeStr
